package guda.mrpc.example.server.service;

import java.util.Random;

/**
 * Created by well on 17/5/24.
 */
public class HelloServiceImpl implements HelloService{
    @Override
    public String say(String name) {
        System.out.println("invoke:"+name);
        return name + new Random().nextInt(100);
    }

    @Override
    public RespDTO say(ReqDTO reqDTO) {
        System.out.println("req:"+reqDTO.getName());
        if("tom".equals(reqDTO.getName())){
            RespDTO respDTO = new RespDTO();
            respDTO.setCard("324232");
            respDTO.setLen(99);
            return respDTO;
        }else{
            RespDTO respDTO = new RespDTO();
            respDTO.setCard("9999");
            respDTO.setLen(88);
            return respDTO;
        }
    }
}
